<?php
class ENotify extends Notify 
{
	function halt($message="",$iff=1,$meta='') 
	{
		$url					= "";
		if ($iff == 1)
		{
			$url				= "Javascript:window.history.go(-1);";
		}
		elseif($iff == "")
		{
			if(isset($_SERVER["HTTP_REFERER"]) && $_SERVER["HTTP_REFERER"] != "")
				$url			= $_SERVER["HTTP_REFERER"];
			else
				$url			= $_SERVER["REQUEST_URI"];
		}
		else
			$url				= $iff;
		if($meta == "" && $iff != 1)
		{
			$meta				= "<meta http-equiv=\"refresh\" content=\"5;URL=$url\" />";
		}
		else 
			$meta				= "<meta http-equiv=\"refresh\" content=\"5;URL=$meta\" />";
		$charset = CHARSET;
		$str = <<< EOT
		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
		<html xmlns="http://www.w3.org/1999/xhtml"> 
		<head> 
		<meta http-equiv="Content-Type" content="text/html; charset=$charset"/> 
		$meta 
		<title>message</title> 
		<link href="/css/notify.css" rel="stylesheet" type="text/css" /> 
		</head> 
		<body> 
		<div class="message"> 
		<div id="caption"> MESSAGE </div> 
		<div id="body">$message</div> 
		<div id="back">[ <a href="$url">back</a> ]</div> 
		</div> 
		</body> 
		</html>
EOT;
if($_SERVER['HTTP_ACCEPT_LANGUAGE'] =='zh-cn')
	//$str = mb_convert_encoding($str,'EUC-CN','UTF-8');

		print("<script language=\"javascript\">\r\n");
		print("output =\"" . str_replace("\r","\\",str_replace("\"","\\\"",$str)) . "\";\r\n");
		print("window.onload = function(){\r\n 
			var oNewDoc = document.open(\"text/html\", \"replace\");\r\n
			oNewDoc.write(output);
    		oNewDoc.close();
		}");
		print("</script>");
		exit;

	}
}
?>